#include <unistd.h>
#include <stdio.h>
#include <sys/wait.h>

int main(int argc, char const *argv[])
{
    
    int pid= fork(); 

    if(pid==0)
    {   //ping  -c 10  www.baidu.com
        char cmd[]="/usr/bin/ping";
        char *args[]={"ping","-c","10","www.baidu.com",NULL};
        char *env[]={NULL};
        int ret= execve(cmd,args,env);
        printf("execve ret=%d\n",ret);
    }

    waitpid(pid,NULL,0);

    return 0;
}
